#include <mem.h>
#include "tmem.h"
#include <stdio.h>

#pragma warning(disable:4996)

void show_cmd();

int main( int argc, char **argv )
{
    int cmd = -1;
    int para;

	pool_init();

    while( 1 )
    {
        switch( cmd )
        {
        case -1:
            show_cmd();
            printf( "cmd >>" );
            scanf( "%d", &cmd );
            break;
        case 0:
            tmem_base();
            printf( "test round:" );
            scanf( "%d", &para );
            printf( "pool   -> " );
            tmem( para, 0 );
            printf( "system -> " );
            tmem( para, 1 );
            cmd = -1;
            break;
        case -2:
            goto end;
        }
    }
    end:
    return 0;
}

void show_cmd()
{
    printf( "-2:    exit\n" );
    printf( "0:     test memory manager\n" );
	printf( "1:		test rbtree\n" );
}